version: '3.6'


services:
    ${VERSION}:
       image: ${IMAGE_URL}/${IMAGE_TAG}
       deploy:
         replicas: ${REPLICAS}
         restart_policy:
           condition: on-failure
       volumes:
         - /logs
         - /etc/timezone:/etc/timezone:ro
         - /etc/localtime:/etc/localtime:ro
       labels:
         aliyun.logs.${LOG_STDOUT}: stdout
         aliyun.logs.${LOG_STDOUT}.tags: app=${APP_NAME},stage=${VERSION}
         aliyun.logs.${LOG_INFO}: /logs/INFO.*.log
         aliyun.logs.${LOG_INFO}.tags: app=${APP_NAME},stage=${VERSION}
         aliyun.logs.${LOG_ERROR}: /logs/ERROR.*.log
         aliyun.logs.${LOG_ERROR}.tags: app=${APP_NAME},stage=${VERSION}
       environment:
         - JAVA_OPTS=${JAVA_OPTS}
         - NACOS_CONFIG_SERVER=${NACOS_CONFIG_SERVER}
         - NACOS_CONFIG_NAMESPACE=${NACOS_CONFIG_NAMESPACE}
         - NACOS_CONFIG_USERNAME=${NACOS_CONFIG_USERNAME}
         - NACOS_CONFIG_PASSWORD=${NACOS_CONFIG_PASSWORD}
       hostname: ${HOSTNAME}
       networks:
         - ${NETWORKS}
networks:
    ${NETWORKS}:
        external: true